<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="exporter-version" content="Evernote Mac 9.4.6 (461470)"/><meta name="altitude" content="6.833415031433105"/><meta name="author" content="704206198@qq.com"/><meta name="created" content="2020-08-15 14:27:00 +0000"/><meta name="latitude" content="31.37538146972656"/><meta name="longitude" content="121.4935321052137"/><meta name="source" content="desktop.mac"/><meta name="updated" content="2021-01-31 14:30:23 +0000"/><meta name="content-class" content="yinxiang.markdown"/><title>拓展：BOWER</title></head><body><div style="font-size: 14px; margin: 0; padding: 0; width: 100%;"><h1 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 41px; border-bottom: 3px double #999; color: #000; margin-top: 14px;">一、介绍</h1>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">Web的软件包管理器</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><a href="https://bower.io/" style="line-height: 160%; box-sizing: content-box; text-decoration: underline; color: #5286bc;">官网</a></p>
<h1 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 41px; border-bottom: 3px double #999; color: #000;">二、安装</h1>
<pre style="line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; margin: 2px 0 8px; background-color: #f5f7f8;"><code style="display: block; overflow-x: auto; background: #1e1e1e; line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; letter-spacing: -.3px; padding: 18px; color: #f4f4f4; white-space: pre-wrap;">npm install -g bower
</code></pre>
<h1 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 41px; border-bottom: 3px double #999; color: #000;">三、使用</h1>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">安装包到全局环境</h3>
<pre style="line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; margin: 2px 0 8px; background-color: #f5f7f8;"><code style="display: block; overflow-x: auto; background: #1e1e1e; line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; letter-spacing: -.3px; padding: 18px; color: #f4f4f4; white-space: pre-wrap;">bower i 包名 -g		安装
bower uninstall 包名 -g	 卸载
</code></pre>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">安装包到项目环境</h3>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">初始化项目环境</h4>
<pre style="line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; margin: 2px 0 8px; background-color: #f5f7f8;"><code style="display: block; overflow-x: auto; background: #1e1e1e; line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; letter-spacing: -.3px; padding: 18px; color: #f4f4f4; white-space: pre-wrap;">bower init
</code></pre>
<blockquote style="line-height: 160%; box-sizing: content-box; margin: 15px 0; border-left: 4px solid #ddd; padding: 0 15px; color: #777;">
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333; margin-top: 0; margin-bottom: 0;">bower.json  第三方包管理配置文件</p>
</blockquote>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">项目依赖</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">只能在当前项目下使用，上线了，也需要这个依赖  <code style="line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; color: #c1788b; padding: 4px 4px 2px 0; letter-spacing: -.3px;">--save</code></p>
<pre style="line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; margin: 2px 0 8px; background-color: #f5f7f8;"><code style="display: block; overflow-x: auto; background: #1e1e1e; line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; letter-spacing: -.3px; padding: 18px; color: #f4f4f4; white-space: pre-wrap;">//安装
同npm
bower install 包名#x.x.x -S 指定版本使用#

//卸载
同npm
</code></pre>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">开发依赖</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">只能在当前项目下使用	，上线了，依赖不需要了 <code style="line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; color: #c1788b; padding: 4px 4px 2px 0; letter-spacing: -.3px;">--save-dev</code></p>
<pre style="line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; margin: 2px 0 8px; background-color: #f5f7f8;"><code style="display: block; overflow-x: auto; background: #1e1e1e; line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; letter-spacing: -.3px; padding: 18px; color: #f4f4f4; white-space: pre-wrap;">同npm
</code></pre>
</div><center style="display:none !important;visibility:collapse !important;height:0 !important;white-space:nowrap;width:100%;overflow:hidden">%23%20%E4%B8%80%E3%80%81%E4%BB%8B%E7%BB%8D%0AWeb%E7%9A%84%E8%BD%AF%E4%BB%B6%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8%0A%0A%5B%E5%AE%98%E7%BD%91%5D(https%3A%2F%2Fbower.io%2F)%0A%0A%23%20%E4%BA%8C%E3%80%81%E5%AE%89%E8%A3%85%0A%0A%60%60%60bash%0Anpm%20install%20-g%20bower%0A%60%60%60%0A%0A%23%20%E4%B8%89%E3%80%81%E4%BD%BF%E7%94%A8%0A%23%23%23%20%E5%AE%89%E8%A3%85%E5%8C%85%E5%88%B0%E5%85%A8%E5%B1%80%E7%8E%AF%E5%A2%83%0A%60%60%60%0Abower%20i%20%E5%8C%85%E5%90%8D%20-g%09%09%E5%AE%89%E8%A3%85%0Abower%20uninstall%20%E5%8C%85%E5%90%8D%20-g%09%20%E5%8D%B8%E8%BD%BD%0A%60%60%60%0A%0A%23%23%23%20%E5%AE%89%E8%A3%85%E5%8C%85%E5%88%B0%E9%A1%B9%E7%9B%AE%E7%8E%AF%E5%A2%83%0A%0A%23%23%23%23%20%E5%88%9D%E5%A7%8B%E5%8C%96%E9%A1%B9%E7%9B%AE%E7%8E%AF%E5%A2%83%0A%0A%60%60%60%0Abower%20init%0A%60%60%60%0A%0A%3E%20bower.json%20%20%E7%AC%AC%E4%B8%89%E6%96%B9%E5%8C%85%E7%AE%A1%E7%90%86%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%0A%0A%23%23%23%23%20%E9%A1%B9%E7%9B%AE%E4%BE%9D%E8%B5%96%0A%0A%E5%8F%AA%E8%83%BD%E5%9C%A8%E5%BD%93%E5%89%8D%E9%A1%B9%E7%9B%AE%E4%B8%8B%E4%BD%BF%E7%94%A8%EF%BC%8C%E4%B8%8A%E7%BA%BF%E4%BA%86%EF%BC%8C%E4%B9%9F%E9%9C%80%E8%A6%81%E8%BF%99%E4%B8%AA%E4%BE%9D%E8%B5%96%20%20%60--save%60%0A%0A%60%60%60%0A%2F%2F%E5%AE%89%E8%A3%85%0A%E5%90%8Cnpm%0Abower%20install%20%E5%8C%85%E5%90%8D%23x.x.x%20-S%20%E6%8C%87%E5%AE%9A%E7%89%88%E6%9C%AC%E4%BD%BF%E7%94%A8%23%0A%0A%2F%2F%E5%8D%B8%E8%BD%BD%0A%E5%90%8Cnpm%0A%60%60%60%0A%0A%23%23%23%23%20%E5%BC%80%E5%8F%91%E4%BE%9D%E8%B5%96%0A%0A%E5%8F%AA%E8%83%BD%E5%9C%A8%E5%BD%93%E5%89%8D%E9%A1%B9%E7%9B%AE%E4%B8%8B%E4%BD%BF%E7%94%A8%09%EF%BC%8C%E4%B8%8A%E7%BA%BF%E4%BA%86%EF%BC%8C%E4%BE%9D%E8%B5%96%E4%B8%8D%E9%9C%80%E8%A6%81%E4%BA%86%20%60--save-dev%60%0A%0A%60%60%60%0A%E5%90%8Cnpm%0A%60%60%60%0A%0A%0A%0A</center></body></html>